package com.lifuixng.picturebackend.model.mapping;

import com.lifuixng.picturebackend.model.dto.picture.PictureEditRequest;
import com.lifuixng.picturebackend.model.dto.picture.PictureReviewRequest;
import com.lifuixng.picturebackend.model.dto.picture.PictureUpdateRequest;
import com.lifuixng.picturebackend.model.entity.Picture;
import com.lifuixng.picturebackend.model.vo.picture.PictureVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * @Author Mr.LiFuXing
 * @Date 2024/12/18 21:17
 * @Title PictureMapping
 * @Package com.lifuixng.picturebackend.model.mapping
 */
@Mapper(componentModel = "spring")
public interface PictureMapping {

    /**
     * 指定字段不映射
     * @param pictureUpdateRequest
     * @return
     */
    @Mapping(target = "tags",ignore = true)
    Picture pictureUpdateRequestToPicture(PictureUpdateRequest pictureUpdateRequest);

    @Mapping(target = "tags",ignore = true)
    PictureVO pictureToPictureVO(Picture picture);

    @Mapping(target = "tags",ignore = true)
    Picture pictureEditRequestToPicture(PictureEditRequest pictureEditRequest);


    Picture pictureReviewRequestToPicture(PictureReviewRequest pictureReviewRequest);

}
